convert googletakeout format to dynamic. (#1167)
authortsteven4 <13596209+tsteven4@users.noreply.github.com>
Tue, 29 Aug 2023 20:39:26 +0000 (14:39 -0600)
committerGitHub <noreply@github.com>
Tue, 29 Aug 2023 20:39:26 +0000 (14:39 -0600)
googletakeout.cc
googletakeout.h
vecs.cc

index d057ca50276aa4ebc6c898d635efb6ec47d76dbe..a962aa49ca5ee094eca15e0dc69367a7a911c9c8 100644 (file)
@@ -217,16 +217,13 @@ GoogleTakeoutFormat::title_case(QString& title)
 }
 
 void
-GoogleTakeoutFormat::rd_init(const QString& fname) {
+GoogleTakeoutFormat::read()
+{
   if (global_opts.debug_level >= 4) {
     Debug(4) << "rd_init(" << fname << ")";
   }
-  inputStream = GoogleTakeoutInputStream(fname);
-}
+  GoogleTakeoutInputStream inputStream(fname);
 
-void
-GoogleTakeoutFormat::read()
-{
   int items = 0;
   int points = 0;
   int place_visits = 0;
index 6bf54b17ad7c45347ff4c7f429dedc95c459099a..ea549f6f530633330d0832dfe65e07bf480ec7bd 100644 (file)
@@ -65,6 +65,8 @@ private:
 class GoogleTakeoutFormat : public Format
 {
 public:
+  using Format::Format;
+
   /* Member functions */
   QVector<arglist_t>* get_args() override
   {
@@ -81,7 +83,8 @@ public:
     return { ff_cap_read, ff_cap_read, ff_cap_none };
   }
 
-  void rd_init(const QString& fname) override;
+  void rd_init(const QString& fname) override
+  {}
   void read() override;
  
 private:
@@ -119,7 +122,6 @@ private:
 
   /* Data Members */
 
-  GoogleTakeoutInputStream inputStream;
   QVector<arglist_t> googletakeout_args;
 };
 
diff --git a/vecs.cc b/vecs.cc
index 150f79a3038ada6079f26f645b2cae6911ff623b..10c5fca2f60a8e405ca6a1f315d3154318483717 100644 (file)
--- a/vecs.cc
+++ b/vecs.cc
@@ -163,7 +163,6 @@ struct Vecs::Impl {
   GeoJsonFormat geojson_fmt;
   GlobalsatSportFormat globalsat_sport_fmt;
   QstarzBL1000Format qstarz_bl_1000_fmt;
-  GoogleTakeoutFormat google_timeline_fmt;
 #endif // MAXIMAL_ENABLED
 
   const QVector<vecs_t> vec_list {
@@ -495,11 +494,12 @@ struct Vecs::Impl {
       nullptr,
     },
     {
-      &google_timeline_fmt,
+      nullptr,
       "googletakeout",
       "Google Takeout Location History",
       "json",
       nullptr,
+      &fmtfactory<GoogleTakeoutFormat>
     }
 #endif // MAXIMAL_ENABLED
   };